<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>

<p> Ricerca ordine </p>
<html:form  action="ricercaOrdine">
    <html:select property="idFornitore">
        <c:forEach  items="${RicercaOrdineForm.fornitori}" var="f" >
           <html:option value="${f.id}"><c:out value="${f.nome}"/></html:option>
        </c:forEach>
    </html:select>

    <html:submit value="cerca" property="selezionaFornitore" />
</html:form>

<layout:form action="ricercaOrdine"  styleClass="FORM">
<layout:panel styleClass="FORM" key="Seleziona il fornitore:" width="100%" align="center">

 
    <layout:submit property="selezionaFornitore">
		<layout:message key="bottone.cerca"/>
	</layout:submit>

</layout:panel>
</layout:form>


<c:import url="../fornitoreOrdineSelezionato.jsp" />


<c:if test="${not empty RicercaOrdineForm.ordini}">

  <html:form action="ricercaOrdine" >
    <ul>
    <c:forEach  items="${RicercaOrdineForm.ordini}" var="ord" >
        <li>
            <html:radio property="idOrdine"  value="${ord.id}"/>
            <c:out value="${ord.numeroOrdineInterno}" />
        </li>
    </c:forEach>
    </ul>
    <html:submit property="selezionaOrdine" value="seleziona"  />
   
  </html:form>


    <!-- Prova Struts-Layout per datagrid -->
	<layout:form action="ricercaOrdine"  reqCode="selezionaOrdine" styleClass="PANEL">
	<layout:row>
		<layout:datagrid property="datagrid" selectionAllowed="true" multipleSelectionAllowed="false" model="datagrid">
			<layout:datagridColumn title="ordineEsterno.id" property="id"/>
			<layout:datagridColumn title="ordineEsterno.dataCreazione" property="dataCreazione"/>
            <layout:datagridColumn title="ordineEsterno.stato" property="stato"/>
            <layout:datagridColumn title="ordineEsterno.numeroOrdineInterno" property="numeroOrdineInterno"/>
		</layout:datagrid>

		<layout:column>
			<layout:submit reqCode="selezionaOrdine" >Seleziona ordine</layout:submit>
		</layout:column>
	</layout:row>
	</layout:form>




</c:if>